#include<signal.h>
#include<t_stdio.h>

int main(void){
    //定义信号集类型变量set
   __sigset_t set;
    //初始化set
    sigemptyset(&set);
    //将2号信号添加到信号集set中
    sigaddset(&set,2);
    sigaddset(&set,3);
    //测试3号信号是不是信号集中的一员
    int is=sigismember(&set,3);
    if(is==-1)E_MSG("sigismember",-1);
    if(is) 
        printf("signum is member of set..\n");
    else printf("signum is not member of set..\n");

    //将3号信号从信号集中移除
    sigdelset(&set , 3);
    is=sigismember(&set,3);
    if(is==-1)E_MSG("sigismember",-1);
    if(is) 
        printf("del signum is member of set..\n");
    else printf("del signum is not member of set..\n");

    return 0;
}